import { Component, OnInit, Output, EventEmitter } from '@angular/core';


@Component({
  selector: 'app-data-menu',
  templateUrl: './data-menu.component.html',
  styleUrls: ['./data-menu.component.scss']
})
export class DataMenuComponent implements OnInit {

  @Output() onClick = new EventEmitter<any>();

  menu = [
    {
      title: '土壤',
      children: [
        {
          title: '国标',
          value: 'tr-gb',
          select: true
        }, {
          title: '省标',
          value: 'tr-sb'
        }, {
          title: '风险评估',
          value: 'tr-fxpg'
        }
      ]
    }, {
      title: '地下水',
      children: [
        {
          title: '国标',
          value: 'dxs-gb'
        }, {
          title: '省标',
          value: 'dxs-sb'
        }, {
          title: '风险评估',
          value: 'dxs-fxpg'
        }
      ]
    }
  ]

  constructor() { }

  ngOnInit() {
    this.onClick.emit(this.menu[0].children[0])
  }

  click(data) {
    this.onClick.emit(data)
  }
}
